home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #64 (1992-08-13)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #64 (1992-08-13)(Amiga User Gruppe Einzugsgebiet 4000).adf / TKEd / rexx / Delete-until-Line.tked < prev    next >
Text File  |  1992-06-12  |  1KB  |  37 lines

  1. /**
  2.  ** ARexx program to delete from the current line down until a specified
  3.  ** word is found 
  4.  **  
  5.  ** © Tom Kroener '92
  6.  **
  7.  **/
  8.  
  9. LF = '0A'X                      /* Linefeed */
  10.  
  11. options results
  12. address 'TKEd.1'                /* Portname of the first started TKEd */
  13. GetNumber "Enter last line"     /* Get the linnumber of the last line to 
  14.                                    delete */
  15. End = result
  16. GetLineNr                       /* Get number of the current line */
  17. Start = result
  18.  
  19. Mark                            /* Beginto mark the block to delete */
  20.  
  21. DO WHILE Start <= End           /* Marks until it reaches the last line 
  22.                                    to delete */
  23.   Cursor "DOWN"                 /* Goto next line */
  24.   Start = Start + 1             /* Increment linecounter */
  25. END
  26.  
  27. Request2 "Delete marked block" LF "Are you sure?"   /* Request the user */
  28.  
  29. IF result = 10 THEN             /* Cancel: Unmark and exit */
  30.   DO; UnmarkBlock
  31.       EXIT 10
  32.   END
  33. Delete                          /* OK    : Delete block */
  34.  
  35. EXIT 0                          /* ciao */
  36.  
  37.